package com.acme.bankapp.domian.bank;

public class CheckingAccount extends AbstractAccount {

	private double overdraft;

    public CheckingAccount(final double balance, final double overdraft) {
        super(balance);
        this.overdraft = overdraft;
    }

    public void withdraw(final double amount) {
        if (this.balance + overdraft >= amount) {
            this.setBalance(this.balance - amount);
        } else {
            System.out.print("Not enough money!");
        }
    }

    public double maximumAmountToWithdraw(){
        return super.getBalance() + overdraft;
    }

}
